package main

import (
	"fmt"
	"math"
)

func main() {
	n := 600851475143

	for i := 2; i <= int(math.Sqrt(float64(n))); i++ {
		if n%i == 0 {
			n = n / i
		}
	}
	fmt.Println(n)
}
